package com.mvc;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.keepitsimple.core.ActionAnnotate;
import com.keepitsimple.core.ActionContext;
import com.keepitsimple.core.Result;

public class UserAction {
	@ActionAnnotate(ActionName="addUser.action",Results={@Result(name="success",value="/index.jsp"),
														 @Result(name="login",value="/login.jsp")
														})
	public String addUser(User user){
		
		System.out.println("aaa");
		return "success";
	}
	@ActionAnnotate(ActionName="add1User.action",Results={@Result(name="success",value="/index.jsp")})
	public String add1User(User user){
		System.out.println(ActionContext.getRequest().getParameter("username"));
		ActionContext.getRequest().setAttribute("username", user.getUsername());
		return "success";
	}
}
